This sample demonstrates how to switch to a private stack correctly. The code is particularly useful for interrupt time programs that need a guaranteed amount of stack space.
The sample compiles for 68K only. Doing this in PPC code is somewhat trickier.
Packing List
The sample contains the following items:
• Read Me About Switch Stack — This document
• Switch Stack.c — Source to the sample
• Switch Stack.r — Source to the sample’s resources.
• Switch Stack.π.rsrc — A compiled version of the above.
• Switch Stack CW.π — A CodeWarrior project for the sample.
• Switch Stack CW — A compiled version of the above.
• Switch Stack MPW.make — A MPW make file for the sample.
• Switch Stack MPW — A compiled version of the above.
• Switch Stack.π — A Think C project for the sample.
• Switch Stack THINK — A compiled version of the above.
Credits and Version History
If you find any problems with this sample, mail <DevSupport@apple.com> with “Attn: Quinn” as the first line of your mail and I’ll try to fix them up.
1.0 (Oct 1993 — May 1995) Jim Luther — I've grouped all previous versions of this sample under version 1.0. See the release notes in "Switch Stack.c".
1.0.1 (Feb 1998) Quinn — Updated a comment in "Switch Stack.c" to emphasise the importance of holding your stack resident if you intend to use it at interrupt time. Added this Read Me document.